//
//  JLPhoto.m
//  JLPhotoBrowser
//
//  Created by liao on 15/12/24.
//  Copyright © 2015年 BangGu. All rights reserved.
//

#import "JLPhoto.h"
#import "UIImageView+WebCache.h"

@implementation JLPhoto

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.clipsToBounds = YES;
        self.userInteractionEnabled  = YES;
        self.contentMode = UIViewContentModeScaleAspectFill;
        
    }
    return self;
}

+(NSArray <JLPhoto *>*)generateJLPhotos:(NSArray <NSString *>*)arr
{
    NSMutableArray *temp = [NSMutableArray array];
    for (int i = 0; i < arr.count; i ++){
        JLPhoto *p = [JLPhoto new];
        p.sourceImageView = [UIImageView new];
        [p.sourceImageView sd_setImageWithURL:[NSURL URLWithString:arr[i]]];
        p.bigImgUrl = arr[i];
        [temp addObject:p];
    }
    
    return temp;
}

@end
